export const MenuMixin = {
  data() {
    return {
      msg: "hello",
      menuData: [],
      menu: [
        {
          path: "/home",
          name: "home",
          label: "首页",
          icon: "s-home",
          url: "Home.vue",
        },
        {
          path: "/mall",
          name: "mall",
          label: "商品管理",
          icon: "video-play",
          url: "Mall.vue",
        },
        {
          path: "/user",
          name: "user",
          label: "用户管理",
          icon: "user",
          url: "User.vue",
        },
        // 图表页面
        {
          label: "图表演示",
          icon: "location",
          path: "/chart",
          name: "chart",
          url: "Chart.vue",
        },
        //3d地图页
        {
          label: "地图演示",
          icon: "location",
          path: "/map3d",
          name: "map3d",
          url: "threeMap.vue",
        },
        {
          label: "其他",
          icon: "location",
          children: [
            {
              path: "/page1",
              name: "page1",
              label: "页面1",
              icon: "setting",
              url: "PageOne.vue",
            },
            {
              path: "/page2",
              name: "page2",
              label: "页面2",
              icon: "setting",
              url: "PageTwo.vue",
            },
            // {
            //   path: "/page3",
            //   name: "page3",
            //   label: "分页练习",
            //   icon: "setting",
            //   url: "PageTest.vue",
            // },
            {
              path: "/page4",
              name: "page3",
              label: "组件使用",
              icon: "setting",
              url: "ComponentTest.vue",
            },
          ],
        },
      ],
    };
  },
  computed: {
    noChildren() {
      return this.menu.filter((item) => !item.children);
    },
    hasChildren() {
      return this.menu.filter((item) => item.children);
    },
  },
  mounted() {
    // console.log(this.noChildren);
  },
};
